const express = require('express');
const groupController = require('../controllers/groupController')
const route = express.Router();
const uploadGroupPic = require('../middleWares/uploadGroupPic')
const updateGroupMulter = require('../middleWares/updateGroup')

route.get('/getGroupInfo/:groupId', groupController.getGroupInfo)
route.post('/createGroup',uploadGroupPic.single('group_pic'), groupController.createGroup)
route.get('/getGroupMember/:groupId', groupController.getGroupMember)
route.get('/getChannel/:groupId', groupController.getChannel)
route.post('/createChannel', groupController.createChannel)
route.post('/updateGroup', updateGroupMulter.fields([{name: "group_pic", maxCount: 1}, {name: "banner", maxCount: 1}]), groupController.updateGroup)
route.get('/getChannelTag', groupController.getChannelTag)
route.post('/createChannelTag', groupController.createChannelTag)

module.exports = route